import request from '@/utils/request'
import { requestPath } from '@/utils/global.js'

export function getDeal(params) { //会员服务协议
    return request({
        url: `${requestPath.sysuser1}/dictionary/dictionary`,
        method: 'get',
        params
    })
}

export function getzcAreement(params) { //用户注册协议
    return request({
        url: `${requestPath.sysuser1}/dictionary/dictionary`,
        method: 'get',
        params
    })
}

export function getMemberAPI(params) { //用户信息
    return request({
        url: `${requestPath.member}/personal-center/get/member`,
        method: 'get',
        params
    })
}

export function messageAPI(params) { //查询是否有未读消息
    return request({
        url: `${requestPath.member}/pm/count`,
        method: 'get',
        params
    })
}

export function feedbackAPI(data) { //意见反馈
    return request({
        url: `${requestPath.sysuser1}/message/save`,
        method: 'post',
        data
    })
}

export function getListAPI(params) { //获取收藏列表
    return request({
        url: `${requestPath.resource}/member-collection/page`,
        method: 'get',
        params
    })
}

export function favAPI(data) { //收藏
    return request({
        url: `${requestPath.resource}/member-collection/batch/save`,
        method: 'post',
        data
    })
}

export function cancelFavAPI(data) { //取消收藏
    return request({
        url: `${requestPath.resource}/member-collection/batch/delete`,
        method: 'post',
        data
    })
}

export function getOrderAPI(data) { //获取订单
    return request({
        url: `${requestPath.order}/order/create-vip-order/new`,
        method: 'post',
        data
    })
}

export function getVipAPI() { //获取vip服务
    return request({
        url: `${requestPath.member}/vip/list`,
        method: 'get'
    })
}

export function loginOutAPI(params) { //退出登录
    return request({
        url: `${requestPath.member}/permissions/logout`,
        method: 'get',
        params
    })
}


export function educationAPI(params) {//学历
    return request({
        url: `${requestPath.resource}/authorLibrary/education/list`,
        method: 'get',
        params
    })
}

export function editAPI(data) { // 编辑个人信息
    return request({
        url: `${requestPath.member}/personal-center/update/member`,
        method: 'post',
        data
    })
}

export function countChangePassAPI(data) { //修改密码
    return request({
        url: `${requestPath.member}/personal-center/update/password`,
        method: 'post',
        data
    })
}

export function getCodeAPI(params) { //发送验证码
    return request({
        url: `${requestPath.member}/personal-center/code-phone`,
        method: 'get',
        params
    })
}

export function updatePhoneAPI(data) { //更换手机号
    return request({
        url: `${requestPath.member}/personal-center/update/phone`,
        method: 'post',
        data
    })
}

export function unBindAPI(data) { //解绑微信
    return request({
        url: `${requestPath.member}/personal-center/unbind/${data}`,
        method: 'post'
    })
}